<!--
 * @Author: 李兵 964368540@qq.com
 * @Date: 2024-05-25 10:13:50
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-07-08 21:00:44
 * @FilePath: \crm\pages\form\photo-order-form.vue
 * @Description: 拍照下单  from
-->
<template>
	<view class="photoBox">
		<u--form labelPosition="top" :model="formData" :rules="rules" ref="formData">
			<u-form-item label="订单照片:" prop="fileList" borderBottom ref="item1">
				<image class="image" :src="formData.orderUrl" mode=""></image>
			</u-form-item>
			<u-form-item label="配送开始时间:"   prop="reservationDeliverTimeStart" borderBottom ref="item1">
				<u--input v-model="formData.reservationDeliverTimeStart" style="pointer-events: none" disabled
					disabledColor="#ffffff"></u--input> 
			</u-form-item>
			<u-form-item label="配送结束时间:"  prop="reservationDeliverTimeEnd" borderBottom ref="item1">
				<u--input v-model="formData.reservationDeliverTimeEnd" style="pointer-events: none" disabled
					disabledColor="#ffffff"></u--input> 
			</u-form-item>
			<u-form-item label="搬运方式:"  prop="transportTypeName" borderBottom ref="item1">
				<u--input v-model="formData.transportTypeName" style="pointer-events: none" disabled
					disabledColor="#ffffff"></u--input> 
			</u-form-item>
			<u-form-item label="地址:" prop="address" borderBottom ref="item1">
				<u--textarea v-model="formData.address" disabled></u--textarea>

			</u-form-item>
			<u-form-item label="买家留言:" prop="problemRemark" borderBottom ref="item1">
				<u--textarea disabled disabledColor="#ffffff" v-model="formData.problemRemark" placeholder="请输入内容"></u--textarea>

			</u-form-item>
		</u--form> 
		</view>
</template>
<script>
	import dayjs from 'dayjs'
	import {
		getToken
	} from "@/config/storage";
	import {
		getById
	} from '@/api/home'
	import {
		jcCustomContactsPage
	} from '@/api/address'

	import uniFilePicker from '@/components/uni-file-picker/components/uni-file-picker/uni-file-picker'
	export default {
		name: "photo-order-form",
		onLoad() {},
		components: {
			uniFilePicker
		},
		data() {
			return {
				id:"",
				transportShow: false,
				show: false,
				value1: Number(new Date()),
				loading: false,
				formData: {
					problemRemark: null,
					reservationDeliverTimeStart: '',
					reservationDeliverTimeEnd: '',
					address: '',
					transportTypeName: '',
					transportType: '',
					orderUrl:''
				},
				fileList: [],
				orderUrl: {
					name: '',
					key: '',
				},
				columns: [
					[{
						label: '楼梯',
						id: 1
					}, {
						label: '电梯',
						id: 2
					}, {
						label: '其他',
						id: 3
					}]
				],
				rules: {
					'problemRemark': {
						type: 'string',
						required: true,
						message: '买家留言',
						trigger: ['blur', 'change']
					},
					'transportTypeName': {
						type: 'string',
						required: true,
						message: '搬运方式',
						trigger: ['blur', 'change']
					}
				},
			};
		},
		onLoad(val) { 
			this.id =val.id
			this.getById()
		},
		methods: {
			async getById() {
				const res = await getById({
					id:this.id
				})
				 if (res) {
					 this.formData.problemRemark = res.problemRemark
					 this.formData.reservationDeliverTimeEnd = res.reservationDeliverTimeEnd
					 this.formData.reservationDeliverTimeStart = res.reservationDeliverTimeStart
					 this.formData.address = res.customContactsAdress
					 this.formData.transportType = res.transportType
					 this.formData.orderUrl = res.orderUrl
					 
					 if (res.transportType ==1) {
						 this.formData.transportTypeName = '楼梯'
					 } else if (res.transportType ==2) {
						 this.formData.transportTypeName = '电梯'
					 } else if (res.transportType ==3) {
						 this.formData.transportTypeName = '其它'
					 }
				 }
			},  
		},
	};
</script>
<style lang="scss" scoped>
	page {
		background: #f2f4f5;

	}
	.image{
		width: 200rpx;
		height: 200rpx;
	}
	.photoBox {
		padding: 10rpx;
		background-color: #fff;
	}

	.btn {
		padding: 20rpx;
	}

	.upstairsType {
		color: #c1c5c9;
		font-size: 15px;
		line-height: 99rpx !important;
		height: 99rpx !important;
	}

	.custom-wrap {
		display: flex;
		align-items: center;
	}
</style>